package com.zyd.blog.personal.controller;

import com.github.pagehelper.PageInfo;
import com.zyd.blog.business.entity.User;
import com.zyd.blog.business.entity.UserInfo;
import com.zyd.blog.business.vo.UserConditionVO;
import com.zyd.blog.business.vo.UserInfoConditionVO;
import com.zyd.blog.framework.object.PageResult;
import com.zyd.blog.personal.service.UserInfoService;
import com.zyd.blog.util.ResultUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

@RestController
@RequestMapping("/front")
public class RestFrontUserController {
    @Resource
    private UserInfoService userInfoService;

    @RequiresPermissions("users")
    @PostMapping("/list")
    public PageResult list(UserInfoConditionVO vo) {
        PageInfo<UserInfo> pageInfo=userInfoService.findPageBreakByCondition(vo);
        return ResultUtil.tablePage(pageInfo);
    }
}